import java.util.Arrays;
import java.util.Random;


public class SortTest {

	public static void main(String[] args){
		short[] array = new short[900 * 1024 * 1024];
		for(int i = 0; i < array.length; i++){
			array[i] = (short) new Random().nextInt();
		}
		Arrays.sort(array);
		for(int i = 0; i < array.length; i++){
			System.out.println(array[i]);
		}
	}
	
}
